package com.iss.okair.db.mapper;

import com.iss.okair.db.entity.AssetsNormal;
import com.iss.okair.db.entity.AssetsPermanent;
import com.iss.okair.db.model.AssetsPermanentModel;
import com.iss.okair.db.mapper.sql.AssetsPermanentSQL;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface AssetsPermanentMapper {
    @SelectProvider(type = AssetsPermanentSQL.class,method = "find")
    List<AssetsPermanent> select(AssetsPermanentModel model);

    //添加
    @Insert("insert into assets_permanent values(#{id},#{assetscode},#{assetstype},#{city},#{address},#{scale},#{util},#{area},#{equitytype},#{namecn},NOW(),#{createuser},#{text})")
    int add(AssetsPermanent permanent);

    //查询全部记录的方法
    @Select("select count(*) from assets_permanent")
    int countALL();

    //修改的方法
    @UpdateProvider(type=AssetsPermanentSQL.class,method = "update")
    int update(AssetsPermanent permanent);

    //根据主键查询数据信息
    @Select("select * from assets_permanent where id=#{id}")
    AssetsPermanent selectById(@Param("id") String id);
}
